#include <QtOpenGL>
#include "cone.h"
#include <GL/glu.h>




Cone::Cone(MainWindow *mainWindow, const QVector3D& center, QObject *parent):
    Object3D(center, parent)
{
     QDir d("../DojoGL/");
     RED = GREEN = BLUE = 255;
/*
     connect(mainWindow, SIGNAL(radioEvent(bool,bool)),
             this, SLOT(FiguraSelecionada(bool,bool)));

     connect(mainWindow, SIGNAL(colorchoose(int)), this, SLOT(RecebeCor(int)));

 */

}

//void Cubo::RecebeMainWindow(MainWindow *mainWindow){
//MW = mainWindow;
//}
/*
void Cone::RecebeCor(int cor){
    if(cor == 0 && isCubo){
        glColor3f(1.0,0.0,0.0);
    }
    else if(cor == 1 && isCubo){glColor3f(0.0,1.0,0.0);}
    else if(cor == 2 && isCubo){glColor3f(0.0,0.0,1.0);}
    //updateGL();
    //else {glColor3f(1,1,1);}

}
*//*
void Cone::FiguraSelecionada(bool obj1,bool obj2){
    if(obj1){
   isCubo = false;
    }
    if(obj2){
    isCubo = true;
    }
}
*/
void Cone::drawGeometry(void)
{
    GLdouble base=1;
    GLdouble top = 0;
    GLdouble height=2;
    GLint slices =50;
    GLint stacks =50;
   glColor3ub(RED,GREEN,BLUE);
    glScalef(0.5,0.5,0.5);


    GLUquadricObj *quadObj = gluNewQuadric();


    gluCylinder(quadObj, base, top, height, slices, stacks);
    gluQuadricOrientation(quadObj, GLU_INSIDE);
    gluDisk(quadObj,0,1,30,1);



}
